import { createApp } from 'vue'
import 'nprogress/nprogress.css'
import App from './App.vue'
import 'element-plus/es/components/message/style/css'
import './style/index.scss'
import {router} from './router'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createPinia } from 'pinia'
import 'animate.css'
import axios from 'axios'

// 引入vue3-json-viewer展示json数据
import JsonViewer from 'vue3-json-viewer'
import 'vue3-json-viewer/dist/index.css';
// v-md-editor进阶版
// @ts-ignore
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
// @ts-ignore
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import Prism from 'prismjs';
// v-md-editor预览组件
// @ts-ignore
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
// @ts-ignore

import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';


// 图片上传
import VueUploadImgs from 'vue-upload-imgs/dist/vue3/VueUploadImgs.esm'




VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});

// highlightjs
import hljs from 'highlight.js';
VMdPreview.use(githubTheme, {
  Hljs: hljs,
});

const app = createApp(App)
app.config.globalProperties.$axios = axios
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(createPinia())
app.use(router)
app.use(JsonViewer)
app.use(VueMarkdownEditor);
app.use(VMdPreview);
app.component('VueUploadImgs', VueUploadImgs);
app.mount('#app')

